package com.homegoods.orderinfodetail.ui.fragment;

import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.homegoods.orderinfodetail.R;
import com.kedll.library.dialog.KBaseDialogFragment;

/**
 * @author QiQi
 * @ClassName: TipDialog
 * @date 2018/9/27
 * @description
 */
public class TipDialog extends KBaseDialogFragment {

    private TextView tvInfo;

    private TextView tvTitle;

    @Override
    public void onResume() {
        super.onResume();
        getDialog().getWindow().setLayout(getResources().getDimensionPixelSize(R.dimen.width_60_80), ViewGroup.LayoutParams.WRAP_CONTENT);
    }


    @Override
    protected void initData(Bundle savedInstanceState) {

        if (!TextUtils.isEmpty(sMsg)) {
            tvInfo.setText(sMsg);
        }

        if(!TextUtils.isEmpty(sTitle)){
            tvTitle.setText(sTitle);
        }

    }

    @Override
    protected void initEvent() {

    }

    @Override
    protected void loadData(Bundle arguments) {

    }

    @Override
    protected int getLayout() {
        return R.layout.info_dialog_tip;
    }

    @Override
    protected void initView(View rootView) {
        findViewById(R.id.btn_confirm).setOnClickListener(v -> dismiss());
        tvInfo = findViewById(R.id.tv_info);
        tvTitle = findViewById(R.id.tv_title);
    }
}
